1. Field of the Invention
The present invention relates to an electronic control unit for a vehicle and method of executing program.
2. Description of Related Art
An electronic control unit (ECU) for a vehicle is equipped with a nonvolatile memory (e.g., flash ROM (Read-Only Memory)) capable of erasing and writing data electronically. As described in Japanese Laid-Open Patent Publication No. 2000-257502, an ECU controls in-vehicle devices (e.g., fuel injector) by a control program or the like stored in the nonvolatile memory.
When a glitch occurs in a control program, the control program is updated to correct the glitch. In this update, a control program with the glitch corrected is transferred from an external device to the ECU, and the corrected control program is written to a nonvolatile memory. For such write processing, a program for writing data of the control program or the like to the nonvolatile memory is prestored in the nonvolatile memory.
However, since the program for writing data to the nonvolatile memory is temporarily used to update the control program or the like, there is no need to store the program in the nonvolatile memory at all times. Thus, the nonvolatile memory has been used wastefully due to the size of the program.